<template>
	<view class="app-overview">
		<view class="person-info">
			<text class="app-title">体检人信息确认</text>

			<view class="info-row">
				<text>体检人姓名：</text>
				<text>{{ orderStore.customerInfo.name }}</text>
			</view>
			<view class="info-row">
				<text>体检人手机：</text>
				<text>{{ orderStore.customerInfo.phone }}</text>
			</view>
			<view class="info-row">
				<text>证件号：</text>
				<text>{{ orderStore.customerInfo.license_number }}</text>
			</view>
		</view>  
 
		<view class="case-info">
			<text class="app-title">已选套餐</text>
 
			<view class="case-item">  
				<view class="item-header">
					<text class="item-title">{{ orderStore.selectedPackage.title }}</text>
				</view>
				<!-- <view class="item-content">
					<text class="item-detail">{{ orderStore.selectedPackage.shorttitle }}</text>
					<text class="item-desc">{{ orderStore.selectedPackage.description }}</text>
				</view>
				<view class="item-row">
					<image :src="imgUrl(orderStore.selectedPackage.image)" mode="aspectFill" />
				</view> -->
			</view>
		</view>

		<view class="case-detail" style="display:none">
			<text class="detail-title">{{ orderStore.selectedPackage.shorttitle }}</text>
			<package-info :currentPackage="currentPackage" :expandedItems="expandedItems" />
		</view>

		<view class="app-button" @click="nextStep">下一步</view>
	</view>
</template>
<script setup>
	import packageInfo from "../../../components/package-info/package-info.vue"
	import {
		onLoad
	} from '@dcloudio/uni-app';
	import {
		useOrderStore
	} from "@/store/order";
	import {
		imgUrl
	} from "../../../utils/global";
	import {
		ref
	} from "vue";
	const orderStore = useOrderStore()
	const expandedItems = ref([]);
	const currentPackage = ref({})
	onLoad(() => {
		currentPackage.value = orderStore.selectedPackage;
		orderStore.selectedPackage.items.forEach(item => {
			expandedItems.value.push(false)
		})
	})
	const nextStep = () => { 
		uni.redirectTo({
			url: '/pages/case/addon/index'
		}); 
	}
</script>
<style src="./style.scss" scoped />